{extend name="layout"}

{block name="style"}
<!-- datatables -->
<link href="__PLUGINS__/dataTables/datatables.min.css" rel="stylesheet">
<link href="__PLUGINS__/dataTables/dataTables.bootstrap4.min.css" rel="stylesheet">
{/block}

{block name="content"}
    <!-- wrapper-content -->
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox-content m-b-sm border-bottom">
                    <div class="p-xs">
                        <div class="float-left m-r-md">
                            <i class="fa fa-cogs text-navy mid-icon"></i>
                        </div>
                        <h2>系统日志管理</h2>
                        <span>日常操作的数据记录。</span>
                    </div>
                </div>
    
                <div class="ibox ">
                    <div class="ibox-title">
                        <h5>系统日志</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b">
                            <div class="col-sm-12">
                                <div class="toolbar-btn-action">
                                    <a title="删除全部" class="btn btn-danger ajax-get confirm"
                                        href="{:url('admin/log/delete?type=all')}"><i
                                            class="fa fa-times-circle-o"></i> 删除全部</a>
                                </div>
                            </div>
                        </div>
    
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover dataTables-example">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>用户名</th>
                                        <th>标题</th>
                                        <th>Url</th>
                                        <th>IP</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
    
                                    {volist name="data" id="vo" key="k"}
                                    <tr class="gradeX">
                                        <td>{$k}</td>
                                        <td>{$vo.username}</td>
                                        <td>{$vo.title}</td>
                                        <td>{$vo.url}</td>
                                        <td>{$vo.ip}</td>
                                        <td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
                                        <td class="tooltip-demo"><a
                                                href="{:url('admin/log/delete?id='.$vo.id)}"
                                                class="ajax-get confirm"><i class="fa fa-trash fa-fw fa-lg text-danger"
                                                    data-toggle="tooltip" data-placement="top" title="删除"></i></a></td>
                                    </tr>
                                    {/volist}
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <th>ID</th>
                                        <th>用户名</th>
                                        <th>标题</th>
                                        <th>Url</th>
                                        <th>IP</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                </tfoot>
                            </table>
                        </div>
    
                    </div>
                </div>
            </div>
        </div>
    </div>


{/block}


{block name="script"}
        
        <!-- dataTables -->
        <script src="__PLUGINS__/dataTables/datatables.min.js"></script>
        <script src="__PLUGINS__/dataTables/dataTables.bootstrap4.min.js"></script>

		<!-- Page-Level Scripts -->
        <script>
            $(document).ready(function() {
                $('.dataTables-example').DataTable({
                    columnDefs:[{targets:[6],orderable:false}],
                    pageLength: 25,
                    responsive: true,
                    dom: '<"html5buttons"B>lTfgitp',
                    processing:true,
                    buttons: [],
                    order: [[ 0, "asc/desc" ]],
                    // 国际化
				    language: {
				        "sProcessing": "处理中...",
				        "sLengthMenu": "显示 _MENU_ 项结果",
				        "sZeroRecords": "没有匹配结果",
				        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
				        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
				        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
				        "sInfoPostFix": "",
				        "sSearch": "搜索:",
				        "sUrl": "",
				        "sEmptyTable": "表中数据为空",
				        "sLoadingRecords": "载入中...",
				        "sInfoThousands": ",",
				        "oPaginate": {
				            "sFirst": "首页",
				            "sPrevious": "上页",
				            "sNext": "下页",
				            "sLast": "末页"
				        },
				        "oAria": {
				            "sSortAscending": ": 以升序排列此列",
				            "sSortDescending": ": 以降序排列此列"
				        }
				    }

                });

            });
        </script>        
{/block}